import 'package:flutter/material.dart';

import '../../config/public_color.dart';

/// FileName text_field_decoration
///
/// @Author lax
/// @Date 2023/3/28
///
/// @Description

class TextFieldDecoration extends InputDecoration {
  static String? defaultHintText;

  static TextStyle? defaultHintStyle;

  static EdgeInsets? defaultPadding =
      const EdgeInsets.symmetric(horizontal: 16);

  TextFieldDecoration({
    String? hintText,
    TextStyle? hitStyle,
    Color fillColor = Colors.transparent,
    EdgeInsets? contentPadding,
  }) : super(
          filled: true,
          fillColor: fillColor,
          hintText: hintText ?? defaultHintText ?? '',
          hintStyle: hitStyle ??
              defaultHintStyle ??
              TextStyle(fontSize: 14, color: PublicColor.lightText),
          contentPadding: contentPadding ?? defaultPadding,
          focusedBorder: _inputBorder(),
          disabledBorder: _inputBorder(),
          errorBorder: _inputBorder(),
          focusedErrorBorder: _inputBorder(),
          enabledBorder: _inputBorder(),
          border: _inputBorder(),
        );

  static InputBorder _inputBorder() {
    return const OutlineInputBorder(
      borderSide: BorderSide(width: 0, color: Colors.transparent),
    );
  }
}
